<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>编辑车辆布控信息</title>
<#include "/common/resource.ftl">
<script type="text/javascript" src="${params.contextPath}/common/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
.layui-form-label{width: 100px;}
.layui-input-block{margin-left: 130px;}
</style>
    <script type="text/javascript">
        $(function () {   //回显的操作
        <#if (params.id)??>
            $.ajaxRequest({
                url: '${params.contextPath}/web/archivesCategory/query.json',
                data:{id:"${params.id}"},
                success:function (data) {
                    if (!data.success) {
                        layer.msg(data.message);
                        return;
                    }
                    var record = data.data;
                    for (var key in record) {  //当要回显的字段与表里的字段一样，则直接选用该种方式
                        $("[name='"+key+"']").val(record[key]);
                    }

                    if (record.parentArc) {   //不一致时，则用该种方式
                        $("[name='parentId']").val(record.parentArc.id);
                        $("[name='parentName']").val(record.parentArc.name);
                    }
                }
            });
        </#if>
        });
    </script>
</head>
<body>
<div class="ui-form">
    <form class="layui-form ajax-form" action="${params.contextPath}/web/archivesCategory/<#if (params.id)??>modify<#else>save</#if>.json" method="post">
        <input type="hidden" name="id" value="${params.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label">车型<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <select name="type">
                	<option value="">--选择车型--</option>
                	<option value="1">轿车</option>
                	<option value="2">客车</option>
                	<option value="3">半挂车</option>
                	<option value="4">载货汽车</option>
                	<option value="5">越野汽车</option>
                	<option value="6">自卸汽车</option>
                	<option value="6">专用汽车</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">车牌号<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" placeholder="请输入分类名称" name="name">
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label">车身颜色</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" placeholder="请输入车身颜色" name="name">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所有人姓名<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" placeholder="请输入所有人姓名" name="name">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所有人身份证<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" placeholder="请输入所有人身份证" name="name">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开始布控时间<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" placeholder="yyyy-MM-dd" name="startTime" id="startTime" readonly="readonly" onclick="new WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',minDate:'%y-%M-{%d+1}'})">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结束布控时间<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" placeholder="yyyy-MM-dd" name="endTime" id="endTime" readonly="readonly" onclick="new WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}'})">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">布控事由<span class="ui-request">*</span></label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" name="remark" placeholder="布控事由，可输入200个字符" maxlength="200"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="submit" value="保存" class="layui-btn"/>
            </div>
        </div>
    </form>
</div>
</body>

</html>
